package com.huishu.coupon.fegin;

import com.huishu.commons.pojo.Result;
import com.huishu.commons.pojo.model.UserDO;
import com.huishu.coupon.fegin.fallback.UserFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @ClassName：UserFeignClient
 * @Author: ljj
 * @Date: 2023/4/10 16:27
 * @Description:
 */
@FeignClient(name = "user-server", path = "/user", fallbackFactory = UserFeignClientFallBack.class)
public interface UserFeignClient {

    /**
     * 获取用户信息
     * @param id
     * @return
     */
    @GetMapping("/user/getUserInfo/{id}")
    Result<UserDO> getUserInfo(@PathVariable Long id);

    /**
     * 根据openId获取用户信息
     * @param openId
     */
    @GetMapping("/user/getUserInfoByOpenId/{openId}")
    Result<UserDO> getUserInfoByOpenId(@PathVariable String openId);
}
